package com.sage.dao.impl;


import org.hibernate.Hibernate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.sage.commons.dao.BaseDao;
import com.sage.dao.CompanyDao;
import com.sage.dao.model.Company;


@SuppressWarnings("unchecked")
@Repository
public class CompanyDaoImpl extends BaseDao<Company, Long> implements CompanyDao{

	@Transactional(readOnly=true)
	@Override
	public Company findByKey(String pnKey) {
		Company company = getByHQL("FROM Company as company WHERE company.pnKey=?", pnKey);
		Hibernate.initialize(company);
		return company;
	}
	
}
